<div class="groups index">
<table class="list_table">
	<tr class="header">
		<th><a href="/admin/groups/index/page:1/sort:id/direction:asc">Id</a></th>
		<th><a href="/admin/groups/index/page:1/sort:name/direction:asc">Name</a></th>
		<th class="action_header">Actions</th>
	</tr>
	<?php
      if(count($this->paginator)) {
         $counter = 0;
      	foreach ($this->paginator as $entry) {
            echo '<tr class="' . ($counter++ % 2 == 0 ? 'row2' : 'row1') . '">'.PHP_EOL;
            echo sprintf('<td class="id">%s</td>', $this->escape($entry['id']));
            echo sprintf('<td>%s</td>', $this->escape($entry['name']));
            $actions = array(
               'edit' => array(
                  'class' => 'edit',
                  'link_text' => '[E]',
                  'link' => '/admin/groups/edit/id/' . $this->escape($entry['id'])
               ),
               'delete' => array(
                  'class' => 'delete',
                  'link_text' => '[D]',
                  'link' => '/admin/groups/delete/id/' . $this->escape($entry['id'])
               )
            );
            $act = '';
            foreach($actions as $action) {
               $link = sprintf('<a class="%s" href="%s">%s</a> ', $action['class'], $action['link'], $action['link_text']);
               $act .= $link;
            }
            echo sprintf('<td class="action_cell">%s</td>', $act);
            echo '</tr>'.PHP_EOL;
      	}
      	
      }
   ?>
</table>
<div class="extra_actions">
   <a href="/admin/groups/add">Add new</a><br />
</div>
<?php echo $this->paginator; ?>
</div>